package com.itheima.dubbo.interfaces;


import com.itheima.commons.model.mongo.Publish;
import org.bson.types.ObjectId;

import java.util.Date;
import java.util.List;

/**
 * 朋友圈相关接口
 */
public interface PublishApi {

    /**
     * 发布朋友圈
     *
     * @param publish
     * @return
     */
    String publish(Publish publish);

    /**
     * 分页查询自己好友的朋友圈列表
     *
     * @param page
     * @param pagesize
     * @param userId
     * @return
     */
    List<Publish> findFriendMovements(Integer page, Integer pagesize, Long userId);

    /**
     * 查询推荐的朋友圈列表
     *
     * @param pids
     * @return
     */
    List<Publish> findMovementsByPids(List<Long> pids);

    /**
     * 随机生成一些朋友圈列表数据
     *
     * @param pagesize
     * @return
     */
    List<Publish> randomMovements(Integer pagesize);

    /**
     * 根据id查询动态
     *
     * @param id 动态id
     * @return
     */
    Publish queryPublishById(String id);


    List<Publish> queryPublishByUid(List<Long> uids, Integer page, Integer pagesize,String sortProp, String sortOrder);

    /**
     * 根据用户id查询圈子
     *
     * @param uids
     * @return
     */
    List<Publish> queryPublishByUid(List<Long> uids, Integer page, Integer pagesize, Long sd, Long ed);

    List<Publish> queryPublishByUid(List<Long> uids, Integer page, Integer pagesize, Long sd, Long ed, int status);

    List<Publish> findAll();


    Integer queryStatus(String id);

    void setAuditing(ObjectId id, Long opsUserId, int status);

    void setTop(ObjectId id, int i);

    List<Publish> queryByAdminIdsAndTimeAndFreezeRemarks(List<Long> adminIds, Date endDate, Date startDate, String operationContent);

    Long countByStatus(int status);

    Long countOneByStatus(String uid, int status);
}
